/*eslint-disable no-prototype-builtins, no-redeclare*/
import * as $protobuf from 'protobufjs/minimal';

// Common aliases
var $Reader = $protobuf.Reader,
  $Writer = $protobuf.Writer,
  $util = $protobuf.util;

// Exported root namespace
var $root = $protobuf.roots['default'] || ($protobuf.roots['default'] = {});

$root.CloudRenderData = (function () {
  /**
   * Properties of a CloudRenderData.
   * @exports ICloudRenderData
   * @interface ICloudRenderData
   * @property {Array.<number>|null} [points] CloudRenderData points
   * @property {Array.<number>|null} [normals] CloudRenderData normals
   * @property {Array.<number>|null} [facets] CloudRenderData facets
   */

  /**
   * Constructs a new CloudRenderData.
   * @exports CloudRenderData
   * @classdesc Represents a CloudRenderData.
   * @implements ICloudRenderData
   * @constructor
   * @param {ICloudRenderData=} [properties] Properties to set
   */
  function CloudRenderData(properties) {
    this.points = [];
    this.normals = [];
    this.facets = [];
    if (properties)
      for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
        if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
  }

  /**
   * CloudRenderData points.
   * @member {Array.<number>} points
   * @memberof CloudRenderData
   * @instance
   */
  CloudRenderData.prototype.points = $util.emptyArray;

  /**
   * CloudRenderData normals.
   * @member {Array.<number>} normals
   * @memberof CloudRenderData
   * @instance
   */
  CloudRenderData.prototype.normals = $util.emptyArray;

  /**
   * CloudRenderData facets.
   * @member {Array.<number>} facets
   * @memberof CloudRenderData
   * @instance
   */
  CloudRenderData.prototype.facets = $util.emptyArray;

  /**
   * Creates a new CloudRenderData instance using the specified properties.
   * @function create
   * @memberof CloudRenderData
   * @static
   * @param {ICloudRenderData=} [properties] Properties to set
   * @returns {CloudRenderData} CloudRenderData instance
   */
  CloudRenderData.create = function create(properties) {
    return new CloudRenderData(properties);
  };

  /**
   * Encodes the specified CloudRenderData message. Does not implicitly {@link CloudRenderData.verify|verify} messages.
   * @function encode
   * @memberof CloudRenderData
   * @static
   * @param {ICloudRenderData} message CloudRenderData message or plain object to encode
   * @param {$protobuf.Writer} [writer] Writer to encode to
   * @returns {$protobuf.Writer} Writer
   */
  CloudRenderData.encode = function encode(message, writer) {
    if (!writer) writer = $Writer.create();
    if (message.points != null && message.points.length) {
      writer.uint32(/* id 1, wireType 2 =*/ 10).fork();
      for (var i = 0; i < message.points.length; ++i)
        writer.float(message.points[i]);
      writer.ldelim();
    }
    if (message.normals != null && message.normals.length) {
      writer.uint32(/* id 2, wireType 2 =*/ 18).fork();
      for (var i = 0; i < message.normals.length; ++i)
        writer.float(message.normals[i]);
      writer.ldelim();
    }
    if (message.facets != null && message.facets.length) {
      writer.uint32(/* id 3, wireType 2 =*/ 26).fork();
      for (var i = 0; i < message.facets.length; ++i)
        writer.uint32(message.facets[i]);
      writer.ldelim();
    }
    return writer;
  };

  /**
   * Encodes the specified CloudRenderData message, length delimited. Does not implicitly {@link CloudRenderData.verify|verify} messages.
   * @function encodeDelimited
   * @memberof CloudRenderData
   * @static
   * @param {ICloudRenderData} message CloudRenderData message or plain object to encode
   * @param {$protobuf.Writer} [writer] Writer to encode to
   * @returns {$protobuf.Writer} Writer
   */
  CloudRenderData.encodeDelimited = function encodeDelimited(message, writer) {
    return this.encode(message, writer).ldelim();
  };

  /**
   * Decodes a CloudRenderData message from the specified reader or buffer.
   * @function decode
   * @memberof CloudRenderData
   * @static
   * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
   * @param {number} [length] Message length if known beforehand
   * @returns {CloudRenderData} CloudRenderData
   * @throws {Error} If the payload is not a reader or valid buffer
   * @throws {$protobuf.util.ProtocolError} If required fields are missing
   */
  CloudRenderData.decode = function decode(reader, length, error) {
    if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
    var end = length === undefined ? reader.len : reader.pos + length,
      message = new $root.CloudRenderData();
    while (reader.pos < end) {
      var tag = reader.uint32();
      if (tag === error) break;
      switch (tag >>> 3) {
        case 1: {
          if (!(message.points && message.points.length)) message.points = [];
          if ((tag & 7) === 2) {
            var end2 = reader.uint32() + reader.pos;
            while (reader.pos < end2) message.points.push(reader.float());
          } else message.points.push(reader.float());
          break;
        }
        case 2: {
          if (!(message.normals && message.normals.length))
            message.normals = [];
          if ((tag & 7) === 2) {
            var end2 = reader.uint32() + reader.pos;
            while (reader.pos < end2) message.normals.push(reader.float());
          } else message.normals.push(reader.float());
          break;
        }
        case 3: {
          if (!(message.facets && message.facets.length)) message.facets = [];
          if ((tag & 7) === 2) {
            var end2 = reader.uint32() + reader.pos;
            while (reader.pos < end2) message.facets.push(reader.uint32());
          } else message.facets.push(reader.uint32());
          break;
        }
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  };

  /**
   * Decodes a CloudRenderData message from the specified reader or buffer, length delimited.
   * @function decodeDelimited
   * @memberof CloudRenderData
   * @static
   * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
   * @returns {CloudRenderData} CloudRenderData
   * @throws {Error} If the payload is not a reader or valid buffer
   * @throws {$protobuf.util.ProtocolError} If required fields are missing
   */
  CloudRenderData.decodeDelimited = function decodeDelimited(reader) {
    if (!(reader instanceof $Reader)) reader = new $Reader(reader);
    return this.decode(reader, reader.uint32());
  };

  /**
   * Verifies a CloudRenderData message.
   * @function verify
   * @memberof CloudRenderData
   * @static
   * @param {Object.<string,*>} message Plain object to verify
   * @returns {string|null} `null` if valid, otherwise the reason why it is not
   */
  CloudRenderData.verify = function verify(message) {
    if (typeof message !== 'object' || message === null)
      return 'object expected';
    if (message.points != null && message.hasOwnProperty('points')) {
      if (!Array.isArray(message.points)) return 'points: array expected';
      for (var i = 0; i < message.points.length; ++i)
        if (typeof message.points[i] !== 'number')
          return 'points: number[] expected';
    }
    if (message.normals != null && message.hasOwnProperty('normals')) {
      if (!Array.isArray(message.normals)) return 'normals: array expected';
      for (var i = 0; i < message.normals.length; ++i)
        if (typeof message.normals[i] !== 'number')
          return 'normals: number[] expected';
    }
    if (message.facets != null && message.hasOwnProperty('facets')) {
      if (!Array.isArray(message.facets)) return 'facets: array expected';
      for (var i = 0; i < message.facets.length; ++i)
        if (!$util.isInteger(message.facets[i]))
          return 'facets: integer[] expected';
    }
    return null;
  };

  /**
   * Creates a CloudRenderData message from a plain object. Also converts values to their respective internal types.
   * @function fromObject
   * @memberof CloudRenderData
   * @static
   * @param {Object.<string,*>} object Plain object
   * @returns {CloudRenderData} CloudRenderData
   */
  CloudRenderData.fromObject = function fromObject(object) {
    if (object instanceof $root.CloudRenderData) return object;
    var message = new $root.CloudRenderData();
    if (object.points) {
      if (!Array.isArray(object.points))
        throw TypeError('.CloudRenderData.points: array expected');
      message.points = [];
      for (var i = 0; i < object.points.length; ++i)
        message.points[i] = Number(object.points[i]);
    }
    if (object.normals) {
      if (!Array.isArray(object.normals))
        throw TypeError('.CloudRenderData.normals: array expected');
      message.normals = [];
      for (var i = 0; i < object.normals.length; ++i)
        message.normals[i] = Number(object.normals[i]);
    }
    if (object.facets) {
      if (!Array.isArray(object.facets))
        throw TypeError('.CloudRenderData.facets: array expected');
      message.facets = [];
      for (var i = 0; i < object.facets.length; ++i)
        message.facets[i] = object.facets[i] >>> 0;
    }
    return message;
  };

  /**
   * Creates a plain object from a CloudRenderData message. Also converts values to other types if specified.
   * @function toObject
   * @memberof CloudRenderData
   * @static
   * @param {CloudRenderData} message CloudRenderData
   * @param {$protobuf.IConversionOptions} [options] Conversion options
   * @returns {Object.<string,*>} Plain object
   */
  CloudRenderData.toObject = function toObject(message, options) {
    if (!options) options = {};
    var object = {};
    if (options.arrays || options.defaults) {
      object.points = [];
      object.normals = [];
      object.facets = [];
    }
    if (message.points && message.points.length) {
      object.points = [];
      for (var j = 0; j < message.points.length; ++j)
        object.points[j] =
          options.json && !isFinite(message.points[j])
            ? String(message.points[j])
            : message.points[j];
    }
    if (message.normals && message.normals.length) {
      object.normals = [];
      for (var j = 0; j < message.normals.length; ++j)
        object.normals[j] =
          options.json && !isFinite(message.normals[j])
            ? String(message.normals[j])
            : message.normals[j];
    }
    if (message.facets && message.facets.length) {
      object.facets = [];
      for (var j = 0; j < message.facets.length; ++j)
        object.facets[j] = message.facets[j];
    }
    return object;
  };

  /**
   * Converts this CloudRenderData to JSON.
   * @function toJSON
   * @memberof CloudRenderData
   * @instance
   * @returns {Object.<string,*>} JSON object
   */
  CloudRenderData.prototype.toJSON = function toJSON() {
    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  };

  /**
   * Gets the default type url for CloudRenderData
   * @function getTypeUrl
   * @memberof CloudRenderData
   * @static
   * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
   * @returns {string} The default type url
   */
  CloudRenderData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
    if (typeUrlPrefix === undefined) {
      typeUrlPrefix = 'type.googleapis.com';
    }
    return typeUrlPrefix + '/CloudRenderData';
  };

  return CloudRenderData;
})();

$root.GeomPoints = (function () {
  /**
   * Properties of a GeomPoints.
   * @exports IGeomPoints
   * @interface IGeomPoints
   * @property {number|null} [id] GeomPoints id
   * @property {Array.<number>|null} [points] GeomPoints points
   */

  /**
   * Constructs a new GeomPoints.
   * @exports GeomPoints
   * @classdesc Represents a GeomPoints.
   * @implements IGeomPoints
   * @constructor
   * @param {IGeomPoints=} [properties] Properties to set
   */
  function GeomPoints(properties) {
    this.points = [];
    if (properties)
      for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
        if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
  }

  /**
   * GeomPoints id.
   * @member {number} id
   * @memberof GeomPoints
   * @instance
   */
  GeomPoints.prototype.id = 0;

  /**
   * GeomPoints points.
   * @member {Array.<number>} points
   * @memberof GeomPoints
   * @instance
   */
  GeomPoints.prototype.points = $util.emptyArray;

  /**
   * Creates a new GeomPoints instance using the specified properties.
   * @function create
   * @memberof GeomPoints
   * @static
   * @param {IGeomPoints=} [properties] Properties to set
   * @returns {GeomPoints} GeomPoints instance
   */
  GeomPoints.create = function create(properties) {
    return new GeomPoints(properties);
  };

  /**
   * Encodes the specified GeomPoints message. Does not implicitly {@link GeomPoints.verify|verify} messages.
   * @function encode
   * @memberof GeomPoints
   * @static
   * @param {IGeomPoints} message GeomPoints message or plain object to encode
   * @param {$protobuf.Writer} [writer] Writer to encode to
   * @returns {$protobuf.Writer} Writer
   */
  GeomPoints.encode = function encode(message, writer) {
    if (!writer) writer = $Writer.create();
    if (message.id != null && Object.hasOwnProperty.call(message, 'id'))
      writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.id);
    if (message.points != null && message.points.length) {
      writer.uint32(/* id 2, wireType 2 =*/ 18).fork();
      for (var i = 0; i < message.points.length; ++i)
        writer.float(message.points[i]);
      writer.ldelim();
    }
    return writer;
  };

  /**
   * Encodes the specified GeomPoints message, length delimited. Does not implicitly {@link GeomPoints.verify|verify} messages.
   * @function encodeDelimited
   * @memberof GeomPoints
   * @static
   * @param {IGeomPoints} message GeomPoints message or plain object to encode
   * @param {$protobuf.Writer} [writer] Writer to encode to
   * @returns {$protobuf.Writer} Writer
   */
  GeomPoints.encodeDelimited = function encodeDelimited(message, writer) {
    return this.encode(message, writer).ldelim();
  };

  /**
   * Decodes a GeomPoints message from the specified reader or buffer.
   * @function decode
   * @memberof GeomPoints
   * @static
   * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
   * @param {number} [length] Message length if known beforehand
   * @returns {GeomPoints} GeomPoints
   * @throws {Error} If the payload is not a reader or valid buffer
   * @throws {$protobuf.util.ProtocolError} If required fields are missing
   */
  GeomPoints.decode = function decode(reader, length, error) {
    if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
    var end = length === undefined ? reader.len : reader.pos + length,
      message = new $root.GeomPoints();
    while (reader.pos < end) {
      var tag = reader.uint32();
      if (tag === error) break;
      switch (tag >>> 3) {
        case 1: {
          message.id = reader.int32();
          break;
        }
        case 2: {
          if (!(message.points && message.points.length)) message.points = [];
          if ((tag & 7) === 2) {
            var end2 = reader.uint32() + reader.pos;
            while (reader.pos < end2) message.points.push(reader.float());
          } else message.points.push(reader.float());
          break;
        }
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  };

  /**
   * Decodes a GeomPoints message from the specified reader or buffer, length delimited.
   * @function decodeDelimited
   * @memberof GeomPoints
   * @static
   * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
   * @returns {GeomPoints} GeomPoints
   * @throws {Error} If the payload is not a reader or valid buffer
   * @throws {$protobuf.util.ProtocolError} If required fields are missing
   */
  GeomPoints.decodeDelimited = function decodeDelimited(reader) {
    if (!(reader instanceof $Reader)) reader = new $Reader(reader);
    return this.decode(reader, reader.uint32());
  };

  /**
   * Verifies a GeomPoints message.
   * @function verify
   * @memberof GeomPoints
   * @static
   * @param {Object.<string,*>} message Plain object to verify
   * @returns {string|null} `null` if valid, otherwise the reason why it is not
   */
  GeomPoints.verify = function verify(message) {
    if (typeof message !== 'object' || message === null)
      return 'object expected';
    if (message.id != null && message.hasOwnProperty('id'))
      if (!$util.isInteger(message.id)) return 'id: integer expected';
    if (message.points != null && message.hasOwnProperty('points')) {
      if (!Array.isArray(message.points)) return 'points: array expected';
      for (var i = 0; i < message.points.length; ++i)
        if (typeof message.points[i] !== 'number')
          return 'points: number[] expected';
    }
    return null;
  };

  /**
   * Creates a GeomPoints message from a plain object. Also converts values to their respective internal types.
   * @function fromObject
   * @memberof GeomPoints
   * @static
   * @param {Object.<string,*>} object Plain object
   * @returns {GeomPoints} GeomPoints
   */
  GeomPoints.fromObject = function fromObject(object) {
    if (object instanceof $root.GeomPoints) return object;
    var message = new $root.GeomPoints();
    if (object.id != null) message.id = object.id | 0;
    if (object.points) {
      if (!Array.isArray(object.points))
        throw TypeError('.GeomPoints.points: array expected');
      message.points = [];
      for (var i = 0; i < object.points.length; ++i)
        message.points[i] = Number(object.points[i]);
    }
    return message;
  };

  /**
   * Creates a plain object from a GeomPoints message. Also converts values to other types if specified.
   * @function toObject
   * @memberof GeomPoints
   * @static
   * @param {GeomPoints} message GeomPoints
   * @param {$protobuf.IConversionOptions} [options] Conversion options
   * @returns {Object.<string,*>} Plain object
   */
  GeomPoints.toObject = function toObject(message, options) {
    if (!options) options = {};
    var object = {};
    if (options.arrays || options.defaults) object.points = [];
    if (options.defaults) object.id = 0;
    if (message.id != null && message.hasOwnProperty('id'))
      object.id = message.id;
    if (message.points && message.points.length) {
      object.points = [];
      for (var j = 0; j < message.points.length; ++j)
        object.points[j] =
          options.json && !isFinite(message.points[j])
            ? String(message.points[j])
            : message.points[j];
    }
    return object;
  };

  /**
   * Converts this GeomPoints to JSON.
   * @function toJSON
   * @memberof GeomPoints
   * @instance
   * @returns {Object.<string,*>} JSON object
   */
  GeomPoints.prototype.toJSON = function toJSON() {
    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  };

  /**
   * Gets the default type url for GeomPoints
   * @function getTypeUrl
   * @memberof GeomPoints
   * @static
   * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
   * @returns {string} The default type url
   */
  GeomPoints.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
    if (typeUrlPrefix === undefined) {
      typeUrlPrefix = 'type.googleapis.com';
    }
    return typeUrlPrefix + '/GeomPoints';
  };

  return GeomPoints;
})();

$root.GeomFaces = (function () {
  /**
   * Properties of a GeomFaces.
   * @exports IGeomFaces
   * @interface IGeomFaces
   * @property {number|null} [id] GeomFaces id
   * @property {Array.<number>|null} [points] GeomFaces points
   * @property {Array.<number>|null} [normals] GeomFaces normals
   * @property {Array.<number>|null} [facets] GeomFaces facets
   * @property {Array.<number>|null} [edges] GeomFaces edges
   * @property {Array.<number>|null} [uvs] GeomFaces uvs
   */

  /**
   * Constructs a new GeomFaces.
   * @exports GeomFaces
   * @classdesc Represents a GeomFaces.
   * @implements IGeomFaces
   * @constructor
   * @param {IGeomFaces=} [properties] Properties to set
   */
  function GeomFaces(properties) {
    this.points = [];
    this.normals = [];
    this.facets = [];
    this.edges = [];
    this.uvs = [];
    if (properties)
      for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
        if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
  }

  /**
   * GeomFaces id.
   * @member {number} id
   * @memberof GeomFaces
   * @instance
   */
  GeomFaces.prototype.id = 0;

  /**
   * GeomFaces points.
   * @member {Array.<number>} points
   * @memberof GeomFaces
   * @instance
   */
  GeomFaces.prototype.points = $util.emptyArray;

  /**
   * GeomFaces normals.
   * @member {Array.<number>} normals
   * @memberof GeomFaces
   * @instance
   */
  GeomFaces.prototype.normals = $util.emptyArray;

  /**
   * GeomFaces facets.
   * @member {Array.<number>} facets
   * @memberof GeomFaces
   * @instance
   */
  GeomFaces.prototype.facets = $util.emptyArray;

  /**
   * GeomFaces edges.
   * @member {Array.<number>} edges
   * @memberof GeomFaces
   * @instance
   */
  GeomFaces.prototype.edges = $util.emptyArray;

  /**
   * GeomFaces uvs.
   * @member {Array.<number>} uvs
   * @memberof GeomFaces
   * @instance
   */
  GeomFaces.prototype.uvs = $util.emptyArray;

  /**
   * Creates a new GeomFaces instance using the specified properties.
   * @function create
   * @memberof GeomFaces
   * @static
   * @param {IGeomFaces=} [properties] Properties to set
   * @returns {GeomFaces} GeomFaces instance
   */
  GeomFaces.create = function create(properties) {
    return new GeomFaces(properties);
  };

  /**
   * Encodes the specified GeomFaces message. Does not implicitly {@link GeomFaces.verify|verify} messages.
   * @function encode
   * @memberof GeomFaces
   * @static
   * @param {IGeomFaces} message GeomFaces message or plain object to encode
   * @param {$protobuf.Writer} [writer] Writer to encode to
   * @returns {$protobuf.Writer} Writer
   */
  GeomFaces.encode = function encode(message, writer) {
    if (!writer) writer = $Writer.create();
    if (message.id != null && Object.hasOwnProperty.call(message, 'id'))
      writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.id);
    if (message.points != null && message.points.length) {
      writer.uint32(/* id 2, wireType 2 =*/ 18).fork();
      for (var i = 0; i < message.points.length; ++i)
        writer.float(message.points[i]);
      writer.ldelim();
    }
    if (message.normals != null && message.normals.length) {
      writer.uint32(/* id 3, wireType 2 =*/ 26).fork();
      for (var i = 0; i < message.normals.length; ++i)
        writer.float(message.normals[i]);
      writer.ldelim();
    }
    if (message.facets != null && message.facets.length) {
      writer.uint32(/* id 4, wireType 2 =*/ 34).fork();
      for (var i = 0; i < message.facets.length; ++i)
        writer.uint32(message.facets[i]);
      writer.ldelim();
    }
    if (message.edges != null && message.edges.length) {
      writer.uint32(/* id 5, wireType 2 =*/ 42).fork();
      for (var i = 0; i < message.edges.length; ++i)
        writer.uint32(message.edges[i]);
      writer.ldelim();
    }
    if (message.uvs != null && message.uvs.length) {
      writer.uint32(/* id 6, wireType 2 =*/ 50).fork();
      for (var i = 0; i < message.uvs.length; ++i) writer.float(message.uvs[i]);
      writer.ldelim();
    }
    return writer;
  };

  /**
   * Encodes the specified GeomFaces message, length delimited. Does not implicitly {@link GeomFaces.verify|verify} messages.
   * @function encodeDelimited
   * @memberof GeomFaces
   * @static
   * @param {IGeomFaces} message GeomFaces message or plain object to encode
   * @param {$protobuf.Writer} [writer] Writer to encode to
   * @returns {$protobuf.Writer} Writer
   */
  GeomFaces.encodeDelimited = function encodeDelimited(message, writer) {
    return this.encode(message, writer).ldelim();
  };

  /**
   * Decodes a GeomFaces message from the specified reader or buffer.
   * @function decode
   * @memberof GeomFaces
   * @static
   * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
   * @param {number} [length] Message length if known beforehand
   * @returns {GeomFaces} GeomFaces
   * @throws {Error} If the payload is not a reader or valid buffer
   * @throws {$protobuf.util.ProtocolError} If required fields are missing
   */
  GeomFaces.decode = function decode(reader, length, error) {
    if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
    var end = length === undefined ? reader.len : reader.pos + length,
      message = new $root.GeomFaces();
    while (reader.pos < end) {
      var tag = reader.uint32();
      if (tag === error) break;
      switch (tag >>> 3) {
        case 1: {
          message.id = reader.int32();
          break;
        }
        case 2: {
          if (!(message.points && message.points.length)) message.points = [];
          if ((tag & 7) === 2) {
            var end2 = reader.uint32() + reader.pos;
            while (reader.pos < end2) message.points.push(reader.float());
          } else message.points.push(reader.float());
          break;
        }
        case 3: {
          if (!(message.normals && message.normals.length))
            message.normals = [];
          if ((tag & 7) === 2) {
            var end2 = reader.uint32() + reader.pos;
            while (reader.pos < end2) message.normals.push(reader.float());
          } else message.normals.push(reader.float());
          break;
        }
        case 4: {
          if (!(message.facets && message.facets.length)) message.facets = [];
          if ((tag & 7) === 2) {
            var end2 = reader.uint32() + reader.pos;
            while (reader.pos < end2) message.facets.push(reader.uint32());
          } else message.facets.push(reader.uint32());
          break;
        }
        case 5: {
          if (!(message.edges && message.edges.length)) message.edges = [];
          if ((tag & 7) === 2) {
            var end2 = reader.uint32() + reader.pos;
            while (reader.pos < end2) message.edges.push(reader.uint32());
          } else message.edges.push(reader.uint32());
          break;
        }
        case 6: {
          if (!(message.uvs && message.uvs.length)) message.uvs = [];
          if ((tag & 7) === 2) {
            var end2 = reader.uint32() + reader.pos;
            while (reader.pos < end2) message.uvs.push(reader.float());
          } else message.uvs.push(reader.float());
          break;
        }
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  };

  /**
   * Decodes a GeomFaces message from the specified reader or buffer, length delimited.
   * @function decodeDelimited
   * @memberof GeomFaces
   * @static
   * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
   * @returns {GeomFaces} GeomFaces
   * @throws {Error} If the payload is not a reader or valid buffer
   * @throws {$protobuf.util.ProtocolError} If required fields are missing
   */
  GeomFaces.decodeDelimited = function decodeDelimited(reader) {
    if (!(reader instanceof $Reader)) reader = new $Reader(reader);
    return this.decode(reader, reader.uint32());
  };

  /**
   * Verifies a GeomFaces message.
   * @function verify
   * @memberof GeomFaces
   * @static
   * @param {Object.<string,*>} message Plain object to verify
   * @returns {string|null} `null` if valid, otherwise the reason why it is not
   */
  GeomFaces.verify = function verify(message) {
    if (typeof message !== 'object' || message === null)
      return 'object expected';
    if (message.id != null && message.hasOwnProperty('id'))
      if (!$util.isInteger(message.id)) return 'id: integer expected';
    if (message.points != null && message.hasOwnProperty('points')) {
      if (!Array.isArray(message.points)) return 'points: array expected';
      for (var i = 0; i < message.points.length; ++i)
        if (typeof message.points[i] !== 'number')
          return 'points: number[] expected';
    }
    if (message.normals != null && message.hasOwnProperty('normals')) {
      if (!Array.isArray(message.normals)) return 'normals: array expected';
      for (var i = 0; i < message.normals.length; ++i)
        if (typeof message.normals[i] !== 'number')
          return 'normals: number[] expected';
    }
    if (message.facets != null && message.hasOwnProperty('facets')) {
      if (!Array.isArray(message.facets)) return 'facets: array expected';
      for (var i = 0; i < message.facets.length; ++i)
        if (!$util.isInteger(message.facets[i]))
          return 'facets: integer[] expected';
    }
    if (message.edges != null && message.hasOwnProperty('edges')) {
      if (!Array.isArray(message.edges)) return 'edges: array expected';
      for (var i = 0; i < message.edges.length; ++i)
        if (!$util.isInteger(message.edges[i]))
          return 'edges: integer[] expected';
    }
    if (message.uvs != null && message.hasOwnProperty('uvs')) {
      if (!Array.isArray(message.uvs)) return 'uvs: array expected';
      for (var i = 0; i < message.uvs.length; ++i)
        if (typeof message.uvs[i] !== 'number') return 'uvs: number[] expected';
    }
    return null;
  };

  /**
   * Creates a GeomFaces message from a plain object. Also converts values to their respective internal types.
   * @function fromObject
   * @memberof GeomFaces
   * @static
   * @param {Object.<string,*>} object Plain object
   * @returns {GeomFaces} GeomFaces
   */
  GeomFaces.fromObject = function fromObject(object) {
    if (object instanceof $root.GeomFaces) return object;
    var message = new $root.GeomFaces();
    if (object.id != null) message.id = object.id | 0;
    if (object.points) {
      if (!Array.isArray(object.points))
        throw TypeError('.GeomFaces.points: array expected');
      message.points = [];
      for (var i = 0; i < object.points.length; ++i)
        message.points[i] = Number(object.points[i]);
    }
    if (object.normals) {
      if (!Array.isArray(object.normals))
        throw TypeError('.GeomFaces.normals: array expected');
      message.normals = [];
      for (var i = 0; i < object.normals.length; ++i)
        message.normals[i] = Number(object.normals[i]);
    }
    if (object.facets) {
      if (!Array.isArray(object.facets))
        throw TypeError('.GeomFaces.facets: array expected');
      message.facets = [];
      for (var i = 0; i < object.facets.length; ++i)
        message.facets[i] = object.facets[i] >>> 0;
    }
    if (object.edges) {
      if (!Array.isArray(object.edges))
        throw TypeError('.GeomFaces.edges: array expected');
      message.edges = [];
      for (var i = 0; i < object.edges.length; ++i)
        message.edges[i] = object.edges[i] >>> 0;
    }
    if (object.uvs) {
      if (!Array.isArray(object.uvs))
        throw TypeError('.GeomFaces.uvs: array expected');
      message.uvs = [];
      for (var i = 0; i < object.uvs.length; ++i)
        message.uvs[i] = Number(object.uvs[i]);
    }
    return message;
  };

  /**
   * Creates a plain object from a GeomFaces message. Also converts values to other types if specified.
   * @function toObject
   * @memberof GeomFaces
   * @static
   * @param {GeomFaces} message GeomFaces
   * @param {$protobuf.IConversionOptions} [options] Conversion options
   * @returns {Object.<string,*>} Plain object
   */
  GeomFaces.toObject = function toObject(message, options) {
    if (!options) options = {};
    var object = {};
    if (options.arrays || options.defaults) {
      object.points = [];
      object.normals = [];
      object.facets = [];
      object.edges = [];
      object.uvs = [];
    }
    if (options.defaults) object.id = 0;
    if (message.id != null && message.hasOwnProperty('id'))
      object.id = message.id;
    if (message.points && message.points.length) {
      object.points = [];
      for (var j = 0; j < message.points.length; ++j)
        object.points[j] =
          options.json && !isFinite(message.points[j])
            ? String(message.points[j])
            : message.points[j];
    }
    if (message.normals && message.normals.length) {
      object.normals = [];
      for (var j = 0; j < message.normals.length; ++j)
        object.normals[j] =
          options.json && !isFinite(message.normals[j])
            ? String(message.normals[j])
            : message.normals[j];
    }
    if (message.facets && message.facets.length) {
      object.facets = [];
      for (var j = 0; j < message.facets.length; ++j)
        object.facets[j] = message.facets[j];
    }
    if (message.edges && message.edges.length) {
      object.edges = [];
      for (var j = 0; j < message.edges.length; ++j)
        object.edges[j] = message.edges[j];
    }
    if (message.uvs && message.uvs.length) {
      object.uvs = [];
      for (var j = 0; j < message.uvs.length; ++j)
        object.uvs[j] =
          options.json && !isFinite(message.uvs[j])
            ? String(message.uvs[j])
            : message.uvs[j];
    }
    return object;
  };

  /**
   * Converts this GeomFaces to JSON.
   * @function toJSON
   * @memberof GeomFaces
   * @instance
   * @returns {Object.<string,*>} JSON object
   */
  GeomFaces.prototype.toJSON = function toJSON() {
    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  };

  /**
   * Gets the default type url for GeomFaces
   * @function getTypeUrl
   * @memberof GeomFaces
   * @static
   * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
   * @returns {string} The default type url
   */
  GeomFaces.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
    if (typeUrlPrefix === undefined) {
      typeUrlPrefix = 'type.googleapis.com';
    }
    return typeUrlPrefix + '/GeomFaces';
  };

  return GeomFaces;
})();

$root.GeomRenderData = (function () {
  /**
   * Properties of a GeomRenderData.
   * @exports IGeomRenderData
   * @interface IGeomRenderData
   * @property {Array.<IGeomPoints>|null} [vertices] GeomRenderData vertices
   * @property {Array.<IGeomPoints>|null} [edges] GeomRenderData edges
   * @property {Array.<IGeomFaces>|null} [faces] GeomRenderData faces
   */

  /**
   * Constructs a new GeomRenderData.
   * @exports GeomRenderData
   * @classdesc Represents a GeomRenderData.
   * @implements IGeomRenderData
   * @constructor
   * @param {IGeomRenderData=} [properties] Properties to set
   */
  function GeomRenderData(properties) {
    this.vertices = [];
    this.edges = [];
    this.faces = [];
    if (properties)
      for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
        if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
  }

  /**
   * GeomRenderData vertices.
   * @member {Array.<IGeomPoints>} vertices
   * @memberof GeomRenderData
   * @instance
   */
  GeomRenderData.prototype.vertices = $util.emptyArray;

  /**
   * GeomRenderData edges.
   * @member {Array.<IGeomPoints>} edges
   * @memberof GeomRenderData
   * @instance
   */
  GeomRenderData.prototype.edges = $util.emptyArray;

  /**
   * GeomRenderData faces.
   * @member {Array.<IGeomFaces>} faces
   * @memberof GeomRenderData
   * @instance
   */
  GeomRenderData.prototype.faces = $util.emptyArray;

  /**
   * Creates a new GeomRenderData instance using the specified properties.
   * @function create
   * @memberof GeomRenderData
   * @static
   * @param {IGeomRenderData=} [properties] Properties to set
   * @returns {GeomRenderData} GeomRenderData instance
   */
  GeomRenderData.create = function create(properties) {
    return new GeomRenderData(properties);
  };

  /**
   * Encodes the specified GeomRenderData message. Does not implicitly {@link GeomRenderData.verify|verify} messages.
   * @function encode
   * @memberof GeomRenderData
   * @static
   * @param {IGeomRenderData} message GeomRenderData message or plain object to encode
   * @param {$protobuf.Writer} [writer] Writer to encode to
   * @returns {$protobuf.Writer} Writer
   */
  GeomRenderData.encode = function encode(message, writer) {
    if (!writer) writer = $Writer.create();
    if (message.vertices != null && message.vertices.length)
      for (var i = 0; i < message.vertices.length; ++i)
        $root.GeomPoints.encode(
          message.vertices[i],
          writer.uint32(/* id 1, wireType 2 =*/ 10).fork(),
        ).ldelim();
    if (message.edges != null && message.edges.length)
      for (var i = 0; i < message.edges.length; ++i)
        $root.GeomPoints.encode(
          message.edges[i],
          writer.uint32(/* id 2, wireType 2 =*/ 18).fork(),
        ).ldelim();
    if (message.faces != null && message.faces.length)
      for (var i = 0; i < message.faces.length; ++i)
        $root.GeomFaces.encode(
          message.faces[i],
          writer.uint32(/* id 3, wireType 2 =*/ 26).fork(),
        ).ldelim();
    return writer;
  };

  /**
   * Encodes the specified GeomRenderData message, length delimited. Does not implicitly {@link GeomRenderData.verify|verify} messages.
   * @function encodeDelimited
   * @memberof GeomRenderData
   * @static
   * @param {IGeomRenderData} message GeomRenderData message or plain object to encode
   * @param {$protobuf.Writer} [writer] Writer to encode to
   * @returns {$protobuf.Writer} Writer
   */
  GeomRenderData.encodeDelimited = function encodeDelimited(message, writer) {
    return this.encode(message, writer).ldelim();
  };

  /**
   * Decodes a GeomRenderData message from the specified reader or buffer.
   * @function decode
   * @memberof GeomRenderData
   * @static
   * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
   * @param {number} [length] Message length if known beforehand
   * @returns {GeomRenderData} GeomRenderData
   * @throws {Error} If the payload is not a reader or valid buffer
   * @throws {$protobuf.util.ProtocolError} If required fields are missing
   */
  GeomRenderData.decode = function decode(reader, length, error) {
    if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
    var end = length === undefined ? reader.len : reader.pos + length,
      message = new $root.GeomRenderData();
    while (reader.pos < end) {
      var tag = reader.uint32();
      if (tag === error) break;
      switch (tag >>> 3) {
        case 1: {
          if (!(message.vertices && message.vertices.length))
            message.vertices = [];
          message.vertices.push(
            $root.GeomPoints.decode(reader, reader.uint32()),
          );
          break;
        }
        case 2: {
          if (!(message.edges && message.edges.length)) message.edges = [];
          message.edges.push($root.GeomPoints.decode(reader, reader.uint32()));
          break;
        }
        case 3: {
          if (!(message.faces && message.faces.length)) message.faces = [];
          message.faces.push($root.GeomFaces.decode(reader, reader.uint32()));
          break;
        }
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  };

  /**
   * Decodes a GeomRenderData message from the specified reader or buffer, length delimited.
   * @function decodeDelimited
   * @memberof GeomRenderData
   * @static
   * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
   * @returns {GeomRenderData} GeomRenderData
   * @throws {Error} If the payload is not a reader or valid buffer
   * @throws {$protobuf.util.ProtocolError} If required fields are missing
   */
  GeomRenderData.decodeDelimited = function decodeDelimited(reader) {
    if (!(reader instanceof $Reader)) reader = new $Reader(reader);
    return this.decode(reader, reader.uint32());
  };

  /**
   * Verifies a GeomRenderData message.
   * @function verify
   * @memberof GeomRenderData
   * @static
   * @param {Object.<string,*>} message Plain object to verify
   * @returns {string|null} `null` if valid, otherwise the reason why it is not
   */
  GeomRenderData.verify = function verify(message) {
    if (typeof message !== 'object' || message === null)
      return 'object expected';
    if (message.vertices != null && message.hasOwnProperty('vertices')) {
      if (!Array.isArray(message.vertices)) return 'vertices: array expected';
      for (var i = 0; i < message.vertices.length; ++i) {
        var error = $root.GeomPoints.verify(message.vertices[i]);
        if (error) return 'vertices.' + error;
      }
    }
    if (message.edges != null && message.hasOwnProperty('edges')) {
      if (!Array.isArray(message.edges)) return 'edges: array expected';
      for (var i = 0; i < message.edges.length; ++i) {
        var error = $root.GeomPoints.verify(message.edges[i]);
        if (error) return 'edges.' + error;
      }
    }
    if (message.faces != null && message.hasOwnProperty('faces')) {
      if (!Array.isArray(message.faces)) return 'faces: array expected';
      for (var i = 0; i < message.faces.length; ++i) {
        var error = $root.GeomFaces.verify(message.faces[i]);
        if (error) return 'faces.' + error;
      }
    }
    return null;
  };

  /**
   * Creates a GeomRenderData message from a plain object. Also converts values to their respective internal types.
   * @function fromObject
   * @memberof GeomRenderData
   * @static
   * @param {Object.<string,*>} object Plain object
   * @returns {GeomRenderData} GeomRenderData
   */
  GeomRenderData.fromObject = function fromObject(object) {
    if (object instanceof $root.GeomRenderData) return object;
    var message = new $root.GeomRenderData();
    if (object.vertices) {
      if (!Array.isArray(object.vertices))
        throw TypeError('.GeomRenderData.vertices: array expected');
      message.vertices = [];
      for (var i = 0; i < object.vertices.length; ++i) {
        if (typeof object.vertices[i] !== 'object')
          throw TypeError('.GeomRenderData.vertices: object expected');
        message.vertices[i] = $root.GeomPoints.fromObject(object.vertices[i]);
      }
    }
    if (object.edges) {
      if (!Array.isArray(object.edges))
        throw TypeError('.GeomRenderData.edges: array expected');
      message.edges = [];
      for (var i = 0; i < object.edges.length; ++i) {
        if (typeof object.edges[i] !== 'object')
          throw TypeError('.GeomRenderData.edges: object expected');
        message.edges[i] = $root.GeomPoints.fromObject(object.edges[i]);
      }
    }
    if (object.faces) {
      if (!Array.isArray(object.faces))
        throw TypeError('.GeomRenderData.faces: array expected');
      message.faces = [];
      for (var i = 0; i < object.faces.length; ++i) {
        if (typeof object.faces[i] !== 'object')
          throw TypeError('.GeomRenderData.faces: object expected');
        message.faces[i] = $root.GeomFaces.fromObject(object.faces[i]);
      }
    }
    return message;
  };

  /**
   * Creates a plain object from a GeomRenderData message. Also converts values to other types if specified.
   * @function toObject
   * @memberof GeomRenderData
   * @static
   * @param {GeomRenderData} message GeomRenderData
   * @param {$protobuf.IConversionOptions} [options] Conversion options
   * @returns {Object.<string,*>} Plain object
   */
  GeomRenderData.toObject = function toObject(message, options) {
    if (!options) options = {};
    var object = {};
    if (options.arrays || options.defaults) {
      object.vertices = [];
      object.edges = [];
      object.faces = [];
    }
    if (message.vertices && message.vertices.length) {
      object.vertices = [];
      for (var j = 0; j < message.vertices.length; ++j)
        object.vertices[j] = $root.GeomPoints.toObject(
          message.vertices[j],
          options,
        );
    }
    if (message.edges && message.edges.length) {
      object.edges = [];
      for (var j = 0; j < message.edges.length; ++j)
        object.edges[j] = $root.GeomPoints.toObject(message.edges[j], options);
    }
    if (message.faces && message.faces.length) {
      object.faces = [];
      for (var j = 0; j < message.faces.length; ++j)
        object.faces[j] = $root.GeomFaces.toObject(message.faces[j], options);
    }
    return object;
  };

  /**
   * Converts this GeomRenderData to JSON.
   * @function toJSON
   * @memberof GeomRenderData
   * @instance
   * @returns {Object.<string,*>} JSON object
   */
  GeomRenderData.prototype.toJSON = function toJSON() {
    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  };

  /**
   * Gets the default type url for GeomRenderData
   * @function getTypeUrl
   * @memberof GeomRenderData
   * @static
   * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
   * @returns {string} The default type url
   */
  GeomRenderData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
    if (typeUrlPrefix === undefined) {
      typeUrlPrefix = 'type.googleapis.com';
    }
    return typeUrlPrefix + '/GeomRenderData';
  };

  return GeomRenderData;
})();

$root.RenderItem = (function () {
  /**
   * Properties of a RenderItem.
   * @exports IRenderItem
   * @interface IRenderItem
   * @property {string|null} [category] RenderItem category
   * @property {string|null} [id] RenderItem id
   * @property {string|null} [type] RenderItem type
   * @property {ICloudRenderData|null} [cloud] RenderItem cloud
   * @property {IGeomRenderData|null} [geom] RenderItem geom
   */

  /**
   * Constructs a new RenderItem.
   * @exports RenderItem
   * @classdesc Represents a RenderItem.
   * @implements IRenderItem
   * @constructor
   * @param {IRenderItem=} [properties] Properties to set
   */
  function RenderItem(properties) {
    if (properties)
      for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
        if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
  }

  /**
   * RenderItem category.
   * @member {string} category
   * @memberof RenderItem
   * @instance
   */
  RenderItem.prototype.category = '';

  /**
   * RenderItem id.
   * @member {string} id
   * @memberof RenderItem
   * @instance
   */
  RenderItem.prototype.id = '';

  /**
   * RenderItem type.
   * @member {string} type
   * @memberof RenderItem
   * @instance
   */
  RenderItem.prototype.type = '';

  /**
   * RenderItem cloud.
   * @member {ICloudRenderData|null|undefined} cloud
   * @memberof RenderItem
   * @instance
   */
  RenderItem.prototype.cloud = null;

  /**
   * RenderItem geom.
   * @member {IGeomRenderData|null|undefined} geom
   * @memberof RenderItem
   * @instance
   */
  RenderItem.prototype.geom = null;

  // OneOf field names bound to virtual getters and setters
  var $oneOfFields;

  /**
   * RenderItem dataFormat.
   * @member {"cloud"|"geom"|undefined} dataFormat
   * @memberof RenderItem
   * @instance
   */
  Object.defineProperty(RenderItem.prototype, 'dataFormat', {
    get: $util.oneOfGetter(($oneOfFields = ['cloud', 'geom'])),
    set: $util.oneOfSetter($oneOfFields),
  });

  /**
   * Creates a new RenderItem instance using the specified properties.
   * @function create
   * @memberof RenderItem
   * @static
   * @param {IRenderItem=} [properties] Properties to set
   * @returns {RenderItem} RenderItem instance
   */
  RenderItem.create = function create(properties) {
    return new RenderItem(properties);
  };

  /**
   * Encodes the specified RenderItem message. Does not implicitly {@link RenderItem.verify|verify} messages.
   * @function encode
   * @memberof RenderItem
   * @static
   * @param {IRenderItem} message RenderItem message or plain object to encode
   * @param {$protobuf.Writer} [writer] Writer to encode to
   * @returns {$protobuf.Writer} Writer
   */
  RenderItem.encode = function encode(message, writer) {
    if (!writer) writer = $Writer.create();
    if (
      message.category != null &&
      Object.hasOwnProperty.call(message, 'category')
    )
      writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.category);
    if (message.id != null && Object.hasOwnProperty.call(message, 'id'))
      writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.id);
    if (message.type != null && Object.hasOwnProperty.call(message, 'type'))
      writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.type);
    if (message.cloud != null && Object.hasOwnProperty.call(message, 'cloud'))
      $root.CloudRenderData.encode(
        message.cloud,
        writer.uint32(/* id 4, wireType 2 =*/ 34).fork(),
      ).ldelim();
    if (message.geom != null && Object.hasOwnProperty.call(message, 'geom'))
      $root.GeomRenderData.encode(
        message.geom,
        writer.uint32(/* id 5, wireType 2 =*/ 42).fork(),
      ).ldelim();
    return writer;
  };

  /**
   * Encodes the specified RenderItem message, length delimited. Does not implicitly {@link RenderItem.verify|verify} messages.
   * @function encodeDelimited
   * @memberof RenderItem
   * @static
   * @param {IRenderItem} message RenderItem message or plain object to encode
   * @param {$protobuf.Writer} [writer] Writer to encode to
   * @returns {$protobuf.Writer} Writer
   */
  RenderItem.encodeDelimited = function encodeDelimited(message, writer) {
    return this.encode(message, writer).ldelim();
  };

  /**
   * Decodes a RenderItem message from the specified reader or buffer.
   * @function decode
   * @memberof RenderItem
   * @static
   * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
   * @param {number} [length] Message length if known beforehand
   * @returns {RenderItem} RenderItem
   * @throws {Error} If the payload is not a reader or valid buffer
   * @throws {$protobuf.util.ProtocolError} If required fields are missing
   */
  RenderItem.decode = function decode(reader, length, error) {
    if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
    var end = length === undefined ? reader.len : reader.pos + length,
      message = new $root.RenderItem();
    while (reader.pos < end) {
      var tag = reader.uint32();
      if (tag === error) break;
      switch (tag >>> 3) {
        case 1: {
          message.category = reader.string();
          break;
        }
        case 2: {
          message.id = reader.string();
          break;
        }
        case 3: {
          message.type = reader.string();
          break;
        }
        case 4: {
          message.cloud = $root.CloudRenderData.decode(reader, reader.uint32());
          break;
        }
        case 5: {
          message.geom = $root.GeomRenderData.decode(reader, reader.uint32());
          break;
        }
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  };

  /**
   * Decodes a RenderItem message from the specified reader or buffer, length delimited.
   * @function decodeDelimited
   * @memberof RenderItem
   * @static
   * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
   * @returns {RenderItem} RenderItem
   * @throws {Error} If the payload is not a reader or valid buffer
   * @throws {$protobuf.util.ProtocolError} If required fields are missing
   */
  RenderItem.decodeDelimited = function decodeDelimited(reader) {
    if (!(reader instanceof $Reader)) reader = new $Reader(reader);
    return this.decode(reader, reader.uint32());
  };

  /**
   * Verifies a RenderItem message.
   * @function verify
   * @memberof RenderItem
   * @static
   * @param {Object.<string,*>} message Plain object to verify
   * @returns {string|null} `null` if valid, otherwise the reason why it is not
   */
  RenderItem.verify = function verify(message) {
    if (typeof message !== 'object' || message === null)
      return 'object expected';
    var properties = {};
    if (message.category != null && message.hasOwnProperty('category'))
      if (!$util.isString(message.category)) return 'category: string expected';
    if (message.id != null && message.hasOwnProperty('id'))
      if (!$util.isString(message.id)) return 'id: string expected';
    if (message.type != null && message.hasOwnProperty('type'))
      if (!$util.isString(message.type)) return 'type: string expected';
    if (message.cloud != null && message.hasOwnProperty('cloud')) {
      properties.dataFormat = 1;
      var error = $root.CloudRenderData.verify(message.cloud);
      if (error) return 'cloud.' + error;
    }
    if (message.geom != null && message.hasOwnProperty('geom')) {
      if (properties.dataFormat === 1) return 'dataFormat: multiple values';
      properties.dataFormat = 1;
      var error = $root.GeomRenderData.verify(message.geom);
      if (error) return 'geom.' + error;
    }
    return null;
  };

  /**
   * Creates a RenderItem message from a plain object. Also converts values to their respective internal types.
   * @function fromObject
   * @memberof RenderItem
   * @static
   * @param {Object.<string,*>} object Plain object
   * @returns {RenderItem} RenderItem
   */
  RenderItem.fromObject = function fromObject(object) {
    if (object instanceof $root.RenderItem) return object;
    var message = new $root.RenderItem();
    if (object.category != null) message.category = String(object.category);
    if (object.id != null) message.id = String(object.id);
    if (object.type != null) message.type = String(object.type);
    if (object.cloud != null) {
      if (typeof object.cloud !== 'object')
        throw TypeError('.RenderItem.cloud: object expected');
      message.cloud = $root.CloudRenderData.fromObject(object.cloud);
    }
    if (object.geom != null) {
      if (typeof object.geom !== 'object')
        throw TypeError('.RenderItem.geom: object expected');
      message.geom = $root.GeomRenderData.fromObject(object.geom);
    }
    return message;
  };

  /**
   * Creates a plain object from a RenderItem message. Also converts values to other types if specified.
   * @function toObject
   * @memberof RenderItem
   * @static
   * @param {RenderItem} message RenderItem
   * @param {$protobuf.IConversionOptions} [options] Conversion options
   * @returns {Object.<string,*>} Plain object
   */
  RenderItem.toObject = function toObject(message, options) {
    if (!options) options = {};
    var object = {};
    if (options.defaults) {
      object.category = '';
      object.id = '';
      object.type = '';
    }
    if (message.category != null && message.hasOwnProperty('category'))
      object.category = message.category;
    if (message.id != null && message.hasOwnProperty('id'))
      object.id = message.id;
    if (message.type != null && message.hasOwnProperty('type'))
      object.type = message.type;
    if (message.cloud != null && message.hasOwnProperty('cloud')) {
      object.cloud = $root.CloudRenderData.toObject(message.cloud, options);
      if (options.oneofs) object.dataFormat = 'cloud';
    }
    if (message.geom != null && message.hasOwnProperty('geom')) {
      object.geom = $root.GeomRenderData.toObject(message.geom, options);
      if (options.oneofs) object.dataFormat = 'geom';
    }
    return object;
  };

  /**
   * Converts this RenderItem to JSON.
   * @function toJSON
   * @memberof RenderItem
   * @instance
   * @returns {Object.<string,*>} JSON object
   */
  RenderItem.prototype.toJSON = function toJSON() {
    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  };

  /**
   * Gets the default type url for RenderItem
   * @function getTypeUrl
   * @memberof RenderItem
   * @static
   * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
   * @returns {string} The default type url
   */
  RenderItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
    if (typeUrlPrefix === undefined) {
      typeUrlPrefix = 'type.googleapis.com';
    }
    return typeUrlPrefix + '/RenderItem';
  };

  return RenderItem;
})();

$root.RenderResponse = (function () {
  /**
   * Properties of a RenderResponse.
   * @exports IRenderResponse
   * @interface IRenderResponse
   * @property {number|null} [code] RenderResponse code
   * @property {number|null} [index] RenderResponse index
   * @property {string|null} [event] RenderResponse event
   * @property {Array.<IRenderItem>|null} [data] RenderResponse data
   */

  /**
   * Constructs a new RenderResponse.
   * @exports RenderResponse
   * @classdesc Represents a RenderResponse.
   * @implements IRenderResponse
   * @constructor
   * @param {IRenderResponse=} [properties] Properties to set
   */
  function RenderResponse(properties) {
    this.data = [];
    if (properties)
      for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
        if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
  }

  /**
   * RenderResponse code.
   * @member {number} code
   * @memberof RenderResponse
   * @instance
   */
  RenderResponse.prototype.code = 0;

  /**
   * RenderResponse index.
   * @member {number} index
   * @memberof RenderResponse
   * @instance
   */
  RenderResponse.prototype.index = 0;

  /**
   * RenderResponse event.
   * @member {string} event
   * @memberof RenderResponse
   * @instance
   */
  RenderResponse.prototype.event = '';

  /**
   * RenderResponse data.
   * @member {Array.<IRenderItem>} data
   * @memberof RenderResponse
   * @instance
   */
  RenderResponse.prototype.data = $util.emptyArray;

  /**
   * Creates a new RenderResponse instance using the specified properties.
   * @function create
   * @memberof RenderResponse
   * @static
   * @param {IRenderResponse=} [properties] Properties to set
   * @returns {RenderResponse} RenderResponse instance
   */
  RenderResponse.create = function create(properties) {
    return new RenderResponse(properties);
  };

  /**
   * Encodes the specified RenderResponse message. Does not implicitly {@link RenderResponse.verify|verify} messages.
   * @function encode
   * @memberof RenderResponse
   * @static
   * @param {IRenderResponse} message RenderResponse message or plain object to encode
   * @param {$protobuf.Writer} [writer] Writer to encode to
   * @returns {$protobuf.Writer} Writer
   */
  RenderResponse.encode = function encode(message, writer) {
    if (!writer) writer = $Writer.create();
    if (message.code != null && Object.hasOwnProperty.call(message, 'code'))
      writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.code);
    if (message.index != null && Object.hasOwnProperty.call(message, 'index'))
      writer.uint32(/* id 2, wireType 0 =*/ 16).int32(message.index);
    if (message.event != null && Object.hasOwnProperty.call(message, 'event'))
      writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.event);
    if (message.data != null && message.data.length)
      for (var i = 0; i < message.data.length; ++i)
        $root.RenderItem.encode(
          message.data[i],
          writer.uint32(/* id 4, wireType 2 =*/ 34).fork(),
        ).ldelim();
    return writer;
  };

  /**
   * Encodes the specified RenderResponse message, length delimited. Does not implicitly {@link RenderResponse.verify|verify} messages.
   * @function encodeDelimited
   * @memberof RenderResponse
   * @static
   * @param {IRenderResponse} message RenderResponse message or plain object to encode
   * @param {$protobuf.Writer} [writer] Writer to encode to
   * @returns {$protobuf.Writer} Writer
   */
  RenderResponse.encodeDelimited = function encodeDelimited(message, writer) {
    return this.encode(message, writer).ldelim();
  };

  /**
   * Decodes a RenderResponse message from the specified reader or buffer.
   * @function decode
   * @memberof RenderResponse
   * @static
   * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
   * @param {number} [length] Message length if known beforehand
   * @returns {RenderResponse} RenderResponse
   * @throws {Error} If the payload is not a reader or valid buffer
   * @throws {$protobuf.util.ProtocolError} If required fields are missing
   */
  RenderResponse.decode = function decode(reader, length, error) {
    if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
    var end = length === undefined ? reader.len : reader.pos + length,
      message = new $root.RenderResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      if (tag === error) break;
      switch (tag >>> 3) {
        case 1: {
          message.code = reader.int32();
          break;
        }
        case 2: {
          message.index = reader.int32();
          break;
        }
        case 3: {
          message.event = reader.string();
          break;
        }
        case 4: {
          if (!(message.data && message.data.length)) message.data = [];
          message.data.push($root.RenderItem.decode(reader, reader.uint32()));
          break;
        }
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  };

  /**
   * Decodes a RenderResponse message from the specified reader or buffer, length delimited.
   * @function decodeDelimited
   * @memberof RenderResponse
   * @static
   * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
   * @returns {RenderResponse} RenderResponse
   * @throws {Error} If the payload is not a reader or valid buffer
   * @throws {$protobuf.util.ProtocolError} If required fields are missing
   */
  RenderResponse.decodeDelimited = function decodeDelimited(reader) {
    if (!(reader instanceof $Reader)) reader = new $Reader(reader);
    return this.decode(reader, reader.uint32());
  };

  /**
   * Verifies a RenderResponse message.
   * @function verify
   * @memberof RenderResponse
   * @static
   * @param {Object.<string,*>} message Plain object to verify
   * @returns {string|null} `null` if valid, otherwise the reason why it is not
   */
  RenderResponse.verify = function verify(message) {
    if (typeof message !== 'object' || message === null)
      return 'object expected';
    if (message.code != null && message.hasOwnProperty('code'))
      if (!$util.isInteger(message.code)) return 'code: integer expected';
    if (message.index != null && message.hasOwnProperty('index'))
      if (!$util.isInteger(message.index)) return 'index: integer expected';
    if (message.event != null && message.hasOwnProperty('event'))
      if (!$util.isString(message.event)) return 'event: string expected';
    if (message.data != null && message.hasOwnProperty('data')) {
      if (!Array.isArray(message.data)) return 'data: array expected';
      for (var i = 0; i < message.data.length; ++i) {
        var error = $root.RenderItem.verify(message.data[i]);
        if (error) return 'data.' + error;
      }
    }
    return null;
  };

  /**
   * Creates a RenderResponse message from a plain object. Also converts values to their respective internal types.
   * @function fromObject
   * @memberof RenderResponse
   * @static
   * @param {Object.<string,*>} object Plain object
   * @returns {RenderResponse} RenderResponse
   */
  RenderResponse.fromObject = function fromObject(object) {
    if (object instanceof $root.RenderResponse) return object;
    var message = new $root.RenderResponse();
    if (object.code != null) message.code = object.code | 0;
    if (object.index != null) message.index = object.index | 0;
    if (object.event != null) message.event = String(object.event);
    if (object.data) {
      if (!Array.isArray(object.data))
        throw TypeError('.RenderResponse.data: array expected');
      message.data = [];
      for (var i = 0; i < object.data.length; ++i) {
        if (typeof object.data[i] !== 'object')
          throw TypeError('.RenderResponse.data: object expected');
        message.data[i] = $root.RenderItem.fromObject(object.data[i]);
      }
    }
    return message;
  };

  /**
   * Creates a plain object from a RenderResponse message. Also converts values to other types if specified.
   * @function toObject
   * @memberof RenderResponse
   * @static
   * @param {RenderResponse} message RenderResponse
   * @param {$protobuf.IConversionOptions} [options] Conversion options
   * @returns {Object.<string,*>} Plain object
   */
  RenderResponse.toObject = function toObject(message, options) {
    if (!options) options = {};
    var object = {};
    if (options.arrays || options.defaults) object.data = [];
    if (options.defaults) {
      object.code = 0;
      object.index = 0;
      object.event = '';
    }
    if (message.code != null && message.hasOwnProperty('code'))
      object.code = message.code;
    if (message.index != null && message.hasOwnProperty('index'))
      object.index = message.index;
    if (message.event != null && message.hasOwnProperty('event'))
      object.event = message.event;
    if (message.data && message.data.length) {
      object.data = [];
      for (var j = 0; j < message.data.length; ++j)
        object.data[j] = $root.RenderItem.toObject(message.data[j], options);
    }
    return object;
  };

  /**
   * Converts this RenderResponse to JSON.
   * @function toJSON
   * @memberof RenderResponse
   * @instance
   * @returns {Object.<string,*>} JSON object
   */
  RenderResponse.prototype.toJSON = function toJSON() {
    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  };

  /**
   * Gets the default type url for RenderResponse
   * @function getTypeUrl
   * @memberof RenderResponse
   * @static
   * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
   * @returns {string} The default type url
   */
  RenderResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
    if (typeUrlPrefix === undefined) {
      typeUrlPrefix = 'type.googleapis.com';
    }
    return typeUrlPrefix + '/RenderResponse';
  };

  return RenderResponse;
})();

export default $root;
